﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YFINGenerator
{
    partial class Program
    {
        static readonly List<VMInfo> vmInfos =
            new List<VMInfo>
                {
                    new VMInfo
                        {
                            Group = "User",
                            Name = "SettingsVM", 
                            Attibutes = new List<string>{"Name:string", "Province:string", "Tel:string", "RemindWay:byte", "PublicLevel:byte", "OldPassword:string", "NewPassword:string", "NewPasswordConfirm:string", "Password:string"},
                            Commands = new List<string>{"Update", "UpdatePassword", "Delete"}
                        },
                   new VMInfo
                        {
                            Group = "User",
                            Name = "MessageVM", 
                            Attibutes = new List<string>{"Messages:List<ModelMessage>", "CurrentMessage:ModelMessage", "MessagesToDelete:List<ModelMessage>"},
                            Commands = new List<string>{"ShowDetail", "Delete"}
                        },
                   new VMInfo
                        {
                            Group = "Toolkit",
                            Name = "RiskPreferVM", 
                            Attibutes = new List<string>{"Questions:List<ModelRiskPreferQuestion>", "Answers:List<ModelRiskPreferAnswer>", "Result:string"},
                            Commands = new List<string>{"Add"}
                        },
                   new VMInfo
                        {
                            Group = "Toolkit",
                            Name = "PropertyVM", 
                            Attibutes = new List<string>{"ProertyTypes:List<ModelPropertyType>", "PropertyTypeName:string", "PropertyTypeRemark:string", "PropertyContentName:string", "Tenure:double", "InitialValue:double", "AnnualizedReturn:double", "MarketValue:double", "PropertyContentRemark:string", "ProertyTypesToDelete:List<ModelPropertyType>", "ProertyContentsToDelete:List<ModelPropertyContent>"},
                            Commands = new List<string>{"AddType", "UpdateType", "DeleteType", "AddContent", "UpdateContent", "DeleteContent"}
                        },
                   new VMInfo
                        {
                            Group = "Toolkit",
                            Name = "ProductVM", 
                            Attibutes = new List<string>{"Products:List<ModelProduct>"},
                            Commands = new List<string>{}
                        },
                   new VMInfo
                        {
                            Group = "Toolkit",
                            Name = "CalculatorVM", 
                            Attibutes = new List<string>{"DepositCapital:double", "DepositType:byte", "DepositStart:DateTime", "DepositExpire:DateTime", "DepositRes:double", 
                                "BondValue:double", "BondPrice:double", "BondStart:DateTime", "BondExpire:DateTime", "BondInterest:double", "BondRes:double", 
                                "ProductCapital:double", "ProductStart:DateTime", "ProductExpire:DateTime", "ProductFinalValue:double", "ProductRes:double", 
                                "FundCurrentCapital:double", "FundMonthCapital:double", "FundStart:DateTime", "FundExpire:DateTime", "FundBenefit:double", "FundRes:double", 
                                "ForeignExchangeType:byte", "ForeignExchangeAmount:double", "ForeignExchangeRes:double", 
                                "PensionStartDate:DateTime", "PensionRetireDate:DateTime", "PensionPersonal:double", "PensionRes:double"},
                            Commands = new List<string>{"DepositCompute", "BondCompute", "ProductCompute", "FundCompute", "ForeignExchangeCompute", "PensionCompute"}
                        },
                   new VMInfo
                        {
                            Group = "NewsAndCourse",
                            Name = "NewsVM", 
                            Attibutes = new List<string>{"News:List<ModelNews>"},
                            Commands = new List<string>{"ShowDetail"}
                        },
                   new VMInfo
                        {
                            Group = "NewsAndCourse",
                            Name = "CourseVM", 
                            Attibutes = new List<string>{"Course:List<ModelCourse>"},
                            Commands = new List<string>{"ShowDetail"}
                        },
                   new VMInfo
                        {
                            Group = "MarketTrend",
                            Name = "FundVM", 
                            Attibutes = new List<string>{"Fund:List<ModelFund>"},
                            Commands = new List<string>{}
                        },
                   new VMInfo
                        {
                            Group = "MarketTrend",
                            Name = "DepositVM", 
                            Attibutes = new List<string>{"Deposit:List<ModelDepositInterest>"},
                            Commands = new List<string>{}
                        },
                   new VMInfo
                        {
                            Group = "MarketTrend",
                            Name = "LoanVM", 
                            Attibutes = new List<string>{"Loan:List<ModelLoanInterest>"},
                            Commands = new List<string>{}
                        },
                   new VMInfo
                        {
                            Group = "MarketTrend",
                            Name = "ForeignExchangeVM", 
                            Attibutes = new List<string>{"ForeignExchange:List<ModelForeignExchange>"},
                            Commands = new List<string>{}
                        },
                   new VMInfo
                        {
                            Group = "MarketTrend",
                            Name = "NobleVM", 
                            Attibutes = new List<string>{"Noble:List<ModelNobleMetal>"},
                            Commands = new List<string>{}
                        },
                   new VMInfo
                        {
                            Group = "Lockbox",
                            Name = "AccountVM", 
                            Attibutes = new List<string>{"Accounts:List<ModelBankAccount>", "Account:ModelBankAccount"},
                            Commands = new List<string>{"Add", "Update", "Delete"}
                        },
                   new VMInfo
                        {
                            Group = "Lockbox",
                            Name = "FileVM", 
                            Attibutes = new List<string>{"CurrentDirectory:ModelFile", "CurrentFile:ModelFile"},
                            Commands = new List<string>{"AddFile", "UpdateFile", "DeleteFile", "AddDirectory", "UpdateDirectory", "DeleteDirectory"}
                        },
                   new VMInfo
                        {
                            Group = "Lockbox",
                            Name = "ReminderVM", 
                            Attibutes = new List<string>{"Reminders:List<ModelReminder>", "Reminder:ModelReminder"},
                            Commands = new List<string>{"Add", "Update", "Delete"}
                        },
                   new VMInfo
                        {
                            Group = "Admin",
                            Name = "UserManageVM", 
                            Attibutes = new List<string>{"Users:List<ModelUser>", "User:ModelUser", "UserName:string"},
                            Commands = new List<string>{"Add", "Update", "Delete"}
                        },
                   new VMInfo
                        {
                            Group = "Admin",
                            Name = "AdminManageVM", 
                            Attibutes = new List<string>{"Admins:List<ModelAdmin>", "Admin:ModelAdmin", "AdminName:string"},
                            Commands = new List<string>{"Add", "Update", "Delete"}
                        },
                   new VMInfo
                        {
                            Group = "Admin",
                            Name = "CourseManageVM", 
                            Attibutes = new List<string>{"Courses:List<ModelCourse>", "Course:ModelCourse"},
                            Commands = new List<string>{"Add", "Update", "Delete"}
                        },
                   new VMInfo
                        {
                            Group = "Admin",
                            Name = "NewsManageVM", 
                            Attibutes = new List<string>{"Newses:List<ModelNews>", "News:ModelCourse"},
                            Commands = new List<string>{"Add", "Update", "Delete"}
                        },
                   new VMInfo
                        {
                            Group = "Admin",
                            Name = "DataManageVM", 
                            Attibutes = new List<string>{"Type:byte", "Time:DateTime", "Data:List<object>", "Datum:object"},
                            Commands = new List<string>{"Add", "Update", "Delete"}
                        },
                };
        static readonly List<EntityInfo> EntityInfos =
                new List<EntityInfo>
                    {
                        new EntityInfo
                            {
                                Name = "YFIN_User",
                                Remark = "用户",
                                Key = "UserName",
                                KeyType = "string",
                                Directory = "User",
                                Attributes =
                                    new List<string>
                                        {
                                            "UserName:string",
                                            "Password:string",
                                             "RemindWay:byte",
                                            "Email:string",
                                             "PublicLevel:byte"
                                        },
                                AttrsNull =
                                    new List<string>
                                        {
                                            "Name:string",
                                            "Nation:string",
                                            "Province:string",
                                            "City:string",
                                            "Age:byte?",
                                            "Gender:bool?",
                                            "Photo:byte[]",
                                            "IndividualSign:string",
                                            "Tel:string",
                                            "QQ:string"
                                        },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            },
                            new EntityInfo
                            {
                                Name = "YFIN_Message",
                                Remark = "消息",
                                Key = "No",
                                KeyType = "long",
                                Directory = "User",
                                Attributes =
                                    new List<string>
                                        {
                                            "No:long",
                                            "Sender:string",
                                            "Receiver:string",
                                            "Time:DateTime",
                                            "IsNew:bool",
                                            "Title:string",
                                            "Content:string",
                                            "Repliable:bool",
                                            "Priority:byte"
                                        },
                                AttrsNull =
                                    new List<string>
                                        {
                                            "Reply:long?"  
                                        },
                                ForeighKey = 
                                    new List<string>
                                        {
                                            "Sender:string",
                                            "Receiver:string",
                                        },
                            },
                             new EntityInfo
                            {
                                Name = "YFIN_RiskPrefer",
                                Remark = "风险偏好评估结果",
                                Key = "No",
                                KeyType = "long",
                                Directory = "Toolkit",
                                Attributes =
                                    new List<string>
                                        {
                                            "No:long",
                                            "UserName:string",
                                            "AnswerNo:long",
                                            "Time:DateTime"
                                        },
                                AttrsNull =
                                    new List<string>
                                        {
                                        },
                                ForeighKey = 
                                    new List<string>
                                        {
                                            "UserName:string",
                                            "AnswerNo:long",
                                        },

                            },
                             new EntityInfo
                            {
                                Name = "YFIN_RiskPreferQuestion",
                                Remark = "风险偏好问卷问题库",
                                Key = "No",
                                KeyType = "long",
                                Directory = "Toolkit",
                                Attributes =
                                    new List<string>
                                        {
                                            "No:long",
                                            "Time:DateTime",
                                            "Content:string",
                                            "Author:string"
                                        },
                                AttrsNull =
                                    new List<string>
                                        {  
                                        },
                                ForeighKey = 
                                    new List<string>
                                        {
                                            "Author:string"
                                        },

                            },
                             new EntityInfo
                            {
                                Name = "YFIN_RiskPreferAnswer",
                                Remark = "风险偏好评估问卷答案库",
                                Key = "No",
                                KeyType = "long",
                                Directory = "Toolkit",
                                Attributes =
                                    new List<string>
                                        {
                                            "No:long",
                                            "QuestionNo:long",
                                            "Content:string",
                                            "Point:byte"
                                        },
                                AttrsNull =
                                    new List<string>
                                        {
                                        },
                                ForeighKey = 
                                    new List<string>
                                        {
                                            "QuestionNo:long",
                                        },

                            },
                             new EntityInfo
                            {
                                Name = "YFIN_Pension",
                                Remark = "养老保险",
                                Key = "No",
                                KeyType = "long",
                                Directory = "Toolkit",
                                Attributes =
                                    new List<string>
                                        {
                                            "No:long",
                                            "Province:string",
                                            "Time:DateTime",
                                            "ExSalGroRate:double",
                                            "AverageSalary:double",
                                            "Available:bool"
                                        },
                                AttrsNull =
                                    new List<string>
                                        {
                                        },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },

                            }, 
                            new EntityInfo
                            {
                                Name = "YFIN_PropertyType",
                                Remark = "资产类型",
                                Key = "No",
                                KeyType = "long",
                                Directory = "Toolkit",
                                Attributes =
                                    new List<string>
                                        {
                                            "No:long",
                                            "Name:string"
                                        },
                                AttrsNull =
                                    new List<string>
                                        {
                                            "Remark:string"
                                        },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },

                            },
                            // new EntityInfo
                            //{
                            //    Name = "YFIN_Property",
                            //    Remark = "资产",
                            //    Key = "No",
                            //    KeyType = "long",
                            //    Directory = "Toolkit",
                            //    Attributes =
                            //        new List<string>
                            //            {
                            //                "No:long",
                            //               "PropertyTypeNo:long",
                            //                "Name:string"
                            //            },
                            //    AttrsNull =
                            //        new List<string>
                            //            {
                            //                "Remark:string"
                            //            },
                            //    ForeighKey = 
                            //        new List<string>
                            //            {
                            //               "PropertyTypeNo:long",
                            //            },

                            //},
                             new EntityInfo
                            {
                                Name = "YFIN_PropertyContent",
                                Remark = "资产内容",
                                Key = "No",
                                KeyType = "long",
                                Directory = "Toolkit",
                                Attributes =
                                    new List<string>
                                        {
                                            "No:long",
                                            "Tenure:double",
                                            "InitialValue:double",
                                            "AnnualizedReturn:double",
                                            "MarketValue:double",
                                            "PropertyTypeNo:long",
                                            "Name:string",
                                            "UserName:string"
                                        },
                                AttrsNull =
                                    new List<string>
                                        {
                                            "Remark:string"
                                        },
                                ForeighKey = 
                                    new List<string>
                                        {
                                            "PropertyTypeNo:long",
                                            "UserName:string"
                                        },
                            },
                             new EntityInfo
                            {
                                Name = "YFIN_Product",
                                Remark = "理财产品详细信息表",
                                Key = "No",
                                KeyType = "long",
                                Directory = "Toolkit",
                                Attributes =
                                    new List<string>
                                        {
                                            "No:long",
                                            "Name:string",
                                            "Bank:string",
                                            "District:string",
                                            "InvestType:byte",
                                            "BenefitType:byte",
                                            "Currency:byte",
                                            "PurchaseAmount:double",
                                            "HiExpectedRev:double",
                                            "Term:int",
                                            "BenefitIllustration:string",
                                            "RiskLevel:double",
                                            "OtherRiskSpec:string",
                                            "PurchaseWay:string",
                                            "StartDate:DateTime",
                                            "ExpireDate:DateTime"
                                        },
                                AttrsNull =
                                    new List<string>
                                        {
                                            "Remark:string"
                                        },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            },
                            new EntityInfo
                            {
                                Name="YFIN_Target",
                                Remark="理财产品投资标的",
                                Key="Name",
                                KeyType="string",
                                Directory = "Toolkit",
                                Attributes=
                                new List<string>
                                {
                                    "Name:string",
                                    "Type:byte"
                                },
                                AttrsNull=
                                new List<string>
                                {
                                    "Remark:string"
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_ProductAndTarget",
                                Remark="理财产品和投资标的关系表",
                                Key="No",
                                KeyType="long",
                                Directory = "Toolkit",
                                Attributes=
                                new List<string>
                                {
                                    "No:long",
                                    "Spec:string",
                                    "HighestWeight:double",
                                    "MinimumWeight:double",
                                    "TargetName:string",
                                    "ProductNo:long"
                                },
                                AttrsNull=
                                    new List<string>
                                {
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                    "TargetName:string",
                                    "ProductNo:long"
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_HistoryDataOfTarget",
                                Remark="理财产品投资标的历史数据",
                                Key="No",
                                KeyType="long",
                                Directory = "Toolkit",
                                Attributes=
                                new List<string>
                                {
                                    "No:long",
                                    "Time:DateTime",
                                    "Value:double",
                                    "TargetName:string"
                                },
                                AttrsNull=
                                new List<string>
                                {
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                    "TargetName:string"
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_RiskType",
                                Remark="理财产品风险类别表",
                                Key="No",
                                KeyType="long",
                                Directory = "Toolkit",
                                Attributes=
                                new List<string>
                                {
                                    "No:long",
                                    "Name:string"
                                },
                                AttrsNull=
                                new List<string>
                                {
                                    "Remark:string"  
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_ProductRisk",
                                Remark="理财产品综合风险表",
                                Key="No",
                                KeyType="long",
                                Directory = "Toolkit",
                                Attributes=
                                new List<string>
                                {
                                    "No:long",
                                    "Level:byte",
                                    "Weight:double",
                                    "ProductNo:long",
                                    "RiskTypeNo:long"
                                },
                                AttrsNull=
                                new List<string>
                                {
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                    "ProductNo:long",
                                    "RiskTypeNo:long"
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_Fund",
                                Remark="基金",
                                Key="No",
                                KeyType="long",
                                Directory = "MarketTrend",
                                Attributes=
                                new List<string>
                                {
                                    "No:long",
                                    "Name:string",
                                    "Code:string",
                                    "ManageCom:string",
                                    "DepositBank:string",
                                    "MarketOrg:string",
                                    "NetValue:double",
                                    "Type:byte",
                                    "InvestOrient:byte",
                                    "InvestStrategy:string",
                                    "Time:DateTime",
                                    "Scale:double",
                                    "CompareStd:string",
                                    "ManagerInfo:string"
                                },
                                AttrsNull=
                                new List<string>
                                {
                                    "Remark:string"
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_DepositInterest",
                                Remark="存款利率",
                                Key="Time",
                                KeyType="DateTime",
                                Directory = "MarketTrend",
                                Attributes=
                                new List<string>
                                {
                                    "Time:DateTime",
                                    "Current:double",
                                    "ThreeMonth:double",
                                    "SixMonth:double",
                                    "OneYear:double",
                                    "TwoYear:double",
                                    "ThreeYear:double",
                                    "FourYear:double",
                                    "FiveYear:double",
                                    "DayNotice:double",
                                    "WeekNotice:double",
                                    "Available:bool"
                                },
                                AttrsNull=
                                new List<string>
                                { 
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_LoanInterest",
                                Remark="贷款利率",
                                Key="Time",
                                KeyType="DateTime",
                                Directory = "MarketTrend",
                                Attributes=
                                new List<string>
                                {
                                    "Time:DateTime",
                                    "HalfYear:double",
                                    "OneYear:double",
                                    "ThreeYear:double",
                                    "FiveYear:double",
                                    "FiveMoreYear:double",
                                    "PerHousFundUn5y:double",
                                    "PerHousFundOv5y:double",
                                    "Available:bool"
                                },
                                AttrsNull=
                                new List<string>
                                {
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_ForeignExchange",
                                Remark="外汇报价",
                                Key="Time",
                                KeyType="DateTime",
                                Directory = "MarketTrend",
                                Attributes=
                                new List<string>
                                {
                                    "Time:DateTime",
                                    "Dollar:double",
                                    "Euro:double",
                                    "HKDollar:double",
                                    "Yen:double",
                                    "Pound:double",
                                    "ADollar:double",
                                    "CDollar:double",
                                    "Available:bool" 
                                },
                                AttrsNull=
                                new List<string>
                                {
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_NobleMetal",
                                Remark="贵金属报价",
                                Key="Time",
                                KeyType="DateTime",
                                Directory = "MarketTrend",
                                Attributes=
                                new List<string>
                                {
                                    "Time:DateTime",
                                    "RMBGold:double",
                                    "RMBSilver:double",
                                    "RMBPlatinum:double",
                                    "DollarGold:double",
                                    "DollarSilver:double",
                                    "DollarPlatinum:double",
                                    "Available:bool" 
                                },
                                AttrsNull=
                                new List<string>
                                { 
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_BankAccount",
                                Remark="银行账户",
                                Key="No",
                                KeyType="long",
                                Directory = "Lockbox",
                                Attributes=
                                new List<string>
                                {
                                    "No:long",
                                    "UserName:string",
                                    "AccountType:byte",
                                    "BankName:string",
                                    "AccountNumber:string",
                                    "AccountPassword:string",
                                    "IsPlain:bool"
                                },
                                AttrsNull=
                                new List<string>
                                { 
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                    "UserName:string",
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_File",
                                Remark="文件",
                                Key="No",
                                KeyType="long",
                                Directory = "Lockbox",
                                Attributes=
                                new List<string>
                                {
                                    "No:long",
                                    "Name:string",
                                    "Type:bool",
                                    "Father:long?",
                                    "UserName:string"
                                },
                                AttrsNull=
                                new List<string>
                                {
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                    "Father:long",
                                    "UserName:string"
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_Reminder",
                                Remark="备忘录",
                                Key="No",
                                KeyType="long",
                                Directory = "Lockbox",
                                Attributes=
                                new List<string>
                                {
                                    "No:long",
                                    "UserName:string",
                                    "Time:DateTime",
                                     "RemindWay:byte"
                                },
                                AttrsNull=
                                new List<string>
                                {
                                    "Content:string"
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                    "UserName:string",
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_Course",
                                Remark="理财课堂",
                                Key="No",
                                KeyType="long",
                                Directory = "NewsAndCourse",
                                Attributes=
                                new List<string>
                                {
                                    "No:long",
                                    "Name:string",
                                    "Url:string"
                                },
                                AttrsNull=
                                new List<string>
                                {
                                    "Summary:string",
                                    "KeyWord:string"
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_News",
                                Remark="理财新闻",
                                Key="No",
                                KeyType="long",
                                Directory = "NewsAndCourse",
                                Attributes=
                                new List<string>
                                {
                                    "No:long",
                                    "Time:DateTime",
                                    "Type:byte",
                                    "Title:string",
                                    "Url:string"
                                },
                                AttrsNull=
                                new List<string>
                                {
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            },
                             new EntityInfo
                            {
                                Name="YFIN_Admin",
                                Remark="管理员",
                                Key="AdminName",
                                KeyType="string",
                                Directory = "Admin",
                                Attributes=
                                new List<string>
                                {
                                    "AdminName:string",
                                    "Password:string",
                                    "Level:bool"
                                },
                                AttrsNull=
                                new List<string>
                                {
                                },
                                ForeighKey = 
                                    new List<string>
                                        {
                                        },
                            }
                    };
    }
}
